﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Xml;
using System.IO;

namespace Team3_ProjectGUIFinal
{
    public partial class combineFiltersForm : Form
    {
        List<Algorithm> algoList;
        List<Algorithm> combineAlgoList;

        public combineFiltersForm(List<Algorithm> aList, List<Algorithm> cList)
        {
            InitializeComponent();

            this.algoList = aList;
            foreach (Algorithm a in algoList)
            {
                FilterListBox.Items.Add(a.getName());
            }

            combineAlgoList = cList;
            foreach (Algorithm a in combineAlgoList)
            {
                CombineFilterListBox.Items.Add(a.getName());
            }
        }

        private void AddFilterButton_Click(object sender, EventArgs e)
        {
            Algorithm selectedAlgorithm = algoList.ElementAt(FilterListBox.SelectedIndex);
            combineAlgoList.Add(selectedAlgorithm);
            CombineFilterListBox.Items.Add(selectedAlgorithm.getName());
        }

        private void CreateNewFilterButton_Click(object sender, EventArgs e)
        {
            Nummerbord.combinedFilterList = combineAlgoList;
            MessageBox.Show("Filter Created");
            this.Close();
        }

        private void ResetButton_Click(object sender, EventArgs e)
        {
            combineAlgoList.Clear();
            CombineFilterListBox.Items.Clear();
        }
    }
}
